﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>抓取数据</title>
    <script src="~/Scripts/jquery-1.9.1.min.js"></script>
    <link href="~/css/amazeui.min.css" rel="stylesheet" />
    <script>
        $(function () {

        })
        function fetchSortList(obj,sid,lid)
        {
            $(obj).prop("disabled", true);
            $.ajax({
                type: "POST",
                url: '@Url.Action("GetSortList_88", "BookApi")',
                dataType: "json",
                data: 'sid=' + sid + '&lid=' + lid,
                success: function (data) {
                    console.log(data);
                    alert("success");
                    $(obj).prop("disabled", false);
                },
                beforeSend: function () {
                },
                complete: function () {
                }
            });
        }
        function fetchChapterList(obj)
        {
            $(obj).prop("disabled", true);
            $.ajax({
                type: "POST",
                url: '@Url.Action("fetchChapterList_88", "BookApi")',
                dataType: "json",
                data: '',
                success: function (data) {
                    console.log(data);
                    alert("success");
                    $(obj).prop("disabled", false);
                },
                beforeSend: function () {
                },
                complete: function () {
                }
            });
        }
    </script>
</head>
<body>
    <div class="am-padding">
        <fieldset>
            <legend>www.8dushu.com抓去并小说目录的url</legend>
            <button onclick="fetchSortList(this,1,1);" class="am-btn am-btn-success">玄幻魔法</button>
            <button onclick="fetchSortList(this,2,10);" class="am-btn am-btn-success">武侠修真</button>
            <button onclick="fetchSortList(this,3,10);" class="am-btn am-btn-success">都市言情</button>
            <button onclick="fetchSortList(this,4,12);" class="am-btn am-btn-success">历史穿越</button>
            <button onclick="fetchSortList(this,5,19);" class="am-btn am-btn-success">恐怖悬疑</button>
            <button onclick="fetchSortList(this,6,12);" class="am-btn am-btn-success">科幻-游戏</button>
            @*<button onclick="fetchSortList(this,1,10);" class="am-btn am-btn-success">女生频道</button>
            <button onclick="fetchSortList(this,1,10);" class="am-btn am-btn-success">综合类型</button>*@
            
            <hr />
            <h2>根据小说目录的URL获取具体章节</h2>
            <button onclick="fetchChapterList(this);" class="am-btn am-btn-success">抓取小说具体章节</button>
        </fieldset>
       
    </div>
</body>
</html>
